package com.gwall.test.plateform.model;


import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.Data;

/**
 * 封装调用开放平台组织信息查询服务返回的机构实体
 * https://open.gwm.cn/goodsdetail?apiDetal=true&group_id=a6a41d00072a4a2e8a15e15c539f0796&api_id=98950799e6874db5988b046d3e3862a9&env_id=7c0f9c0526eb4783a3b06ae32f871931
 * 叫 GroupModel 是因为接口返回数据的关键字段名对应
 * {
 *      "id": 10792,
 *      "group_name": "云视车联科技有限公司",
 *      "group_name_en": "云视车联科技有限公司",
 *      "parent_id": 13756,
 *      "level": 4,
 *      "show_order": 31,
 *      "grade": 10,
 *      "direct_leader": "GW00170251",
 *      "direct_leader_name": "王竞",
 *      "group_tel": "0312-2197822",
 *      "unit_id": 2,
 *      "unit_name": "长城汽车股份有限公司",
 *      "department_id": 13756,
 *      "department_name": "如果科技有限公司",
 *      "team_id": 10792,
 *      "team_name": "云视车联科技有限公司",
 *      "delete_flag": false,
 *      "update_time": "2023-09-21 09:55:45",
 *      "children": [],
 *      "parent_group_name": null
 * }
 */

@Data
public class GroupModel {

    private Long id;

    @JsonAlias(value = {"group_name", "groupName"})
    private String groupName;

    @JsonAlias(value = {"group_name_en", "groupNameEn"})
    private String groupNameEN;

    @JsonAlias(value = {"parent_id", "parentId"})
    private Long parentId;

    private Long level; // 无效 2023-12-31下架

    @JsonAlias(value = {"show_order", "showOrder"})
    private Long showOrder;

    private Long grade;

    @JsonAlias(value = {"direct_leader", "directLeader"})
    private String directLeader;      // 领导工号

    @JsonAlias(value = {"direct_leader_name", "directLeaderName"})
    private String directLeaderName;  // 领导姓名

    @JsonAlias(value = {"group_tel", "groupTel"})
    private String groupTel;

//    @JsonAlias(value = {"unit_id", "unitId"})
//    private Long unitId;
//
//    @JsonAlias(value = {"unit_name", "unitName"})
//    private String unitName;

//    @JsonAlias(value = {"department_id", "departmentId"})
//    private Long departmentId;
//
//    @JsonAlias(value = {"department_name", "departmentName"})
//    private String departmentName;
//
//    @JsonAlias(value = {"team_id", "teamId"})
//    private Long teamId;
//
//    @JsonAlias(value = {"team_name", "teamName"})
//    private String teamName;

    @JsonAlias(value = {"delete_flag", "deleteFlag"})
    private Boolean deleteFlag;

    @JsonAlias(value = {"update_time", "updateTime"})
    private String updateTime;

    // "children": []

    @JsonAlias(value = {"parent_group_name", "parentGroupName"})
    private String parentGroupName;
}
